package com.dkd.findmyfriends;

import android.graphics.Bitmap;
import android.util.SparseArray;


public class GameSettings {
	
    private static String gridSize = "3x4";
	private static int numCols = 3;
	private static int numRows = 4;
	private static int settingsPosSelected = 0;
	private static boolean landscape = false;
	

	public static SparseArray<Bitmap> imagesSelected = new SparseArray<Bitmap>();
	
	public static String getGridSize() {
		return gridSize;
	}
	public static void setGridSize(String gridSize) {
		GameSettings.gridSize = gridSize;
	}
	public static int getNumCols() {
		return landscape ? numRows : numCols;
	}
	public static void setNumCols(int numCols) {
		GameSettings.numCols = numCols;
	}
	public static int getNumRows() {
		return landscape ? numCols : numRows;
	}
	public static void setNumRows(int numRows) {
		GameSettings.numRows = numRows;
	}
	public static int getMaxNumImages() {
		return numCols*numRows/2;
	}
	public static int getSettingsPosSelected() {
		return settingsPosSelected;
	}
	public static void setSettingsPosSelected(int settingsPosSelected) {
		GameSettings.settingsPosSelected = settingsPosSelected;
	}
	public static boolean isLandscape() {
		return landscape;
	}
	public static void setLandscape(boolean landscape) {
		GameSettings.landscape = landscape;
	}
	
	public static String getTimeString(long millis) {
		String format = String.format("%%0%dd", 2);
		millis = millis / 1000;
		String seconds = String.format(format, millis % 60);
		String minutes = String.format(format, (millis % 3600) / 60);
		String hours = String.format(format, millis / 3600);
		String time =  hours + ":" + minutes + ":" + seconds;
		return time;
	}
	
}
